/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('user', {
		id: {
			type: DataTypes.BIGINT,
			allowNull: false,
			primaryKey: true,
			autoIncrement: true,
			field: 'id'
		},
		nickName: {
			type: DataTypes.STRING(30),
			allowNull: true,
			field: 'nick_name'
		},
		password: {
			type: DataTypes.STRING(30),
			allowNull: true,
			field: 'password'
		},
		phoneNo: {
			type: DataTypes.STRING(20),
			allowNull: false,
			defaultValue: '',
			unique: true,
			field: 'phone_no'
		},
		status: {
			type: DataTypes.INTEGER(2),
			allowNull: true,
			defaultValue: '1',
			field: 'status'
		},
		userType: {
			type: DataTypes.INTEGER(2),
			allowNull: true,
			defaultValue: '1',
			field: 'user_type'
		},
		createdTime: {
			type: DataTypes.DATE,
			allowNull: true,
			field: 'created_time'
		},
		updatedTime: {
			type: DataTypes.DATE,
			allowNull: true,
			field: 'updated_time'
		}
	}, {
		tableName: 'user'
	});
};
